package com.wuyou.designPatterns.chainofresponsibility;

/**
 * Main
 *
 * @Date 2024/10/12 15:23
 * @Author 无忧
 */
public class Main {


    public static void main(String[] args) {
        Support a = new NoSupport("a");
        Support b = new LimitSupport("b", 100);
        Support c = new SpecialSupport("c", 429);
        Support d = new OddSupport("d");
        Support e = new LimitSupport("e", 300);

        // 形成职责链
        a.setNext(b).setNext(c).setNext(d).setNext(e);

        for(int i=0; i<500; i++){
            a.support(new Trouble(i));
        }
    }
}
